ng-include(src="'app/components/navbar/navbar.html'")

.dashboard-page
	.dashboard-landing
		h2.create-title Create
		.button-container
			.create-button.create-quiz-button(ng-show='defaultDashboardStatus', ng-click='launchQuizGenerator()')
				p.pistara New Quiz
			.create-button.create-vote-button(ng-show='defaultDashboardStatus', ng-click='launchSurveyGenerator()')
				p.pistara New Questionnaire

	.container-fluid.dashboard-main-quiz(ng-hide='quizDashboardStatus')
		.quiz-generator
			.row
				.col-lg-3.col-md-3.col-sm-6.col-xs-12.dashboard-sidebar
					h1 Welcome, {{userName}}
					h1 My Quizzes
					.user-quizzes
						.user-quiz(ng-repeat='quiz in userData.quizzes track by $index', ng-click='reviewQuiz($event)') 
							p Title: {{ quiz.name }}
							p Length: {{ quiz.length }} questions
				.col-lg-9.col-md-9.col-sm-6.col-xs-12
					.list-generator(ng-hide='quizCreateStatus')
						h2.title-text Create Quiz
						form(name='newQuiz' ng-submit='createNewQuiz()')
							input.quiz-name(type='text', name='name', class='form-control' ng-model='quiz.name' placeholder='SURVEY NAME')
							.row.question-row(ng-repeat='question in questionForm')
								.col-lg-6.col-md-6.col-sm-6.col-xs-12.question-column
									input.question-input(placeholder='QUESTION {{ $index + 1}}', type='text', name='question', class='form-control', ng-model="quiz.questions['q'+$index].name", ng-keydown='addNewQuestionToForm($event)')
								.col-lg-6.col-md-6.col-sm-6.col-xs-12.answer-column
									input.answer-input(placeholder='ANSWER CHOICE A', type='text', name='answer', class='form-control', ng-model="quiz.questions['q'+$index].answers.a")
									input.answer-input(placeholder='ANSWER CHOICE B', type='text', name='answer', class='form-control', ng-model="quiz.questions['q'+$index].answers.b")
									input.answer-input(placeholder='ANSWER CHOICE C', type='text', name='answer', class='form-control', ng-model="quiz.questions['q'+$index].answers.c")
									input.answer-input(placeholder='ANSWER CHOICE D', type='text', name='answer', class='form-control', ng-model="quiz.questions['q'+$index].answers.d")
									//span(ng-repeat='answer in questionFormAnswers')
										input.answer-input(placeholder='ANSWER CHOICE {{ letters[$index] }}', type='text', name='answer', class='form-control', ng-model="quiz.questions['q'+$parent.$index].answers['a'+$index].content", ng-keydown='addNewAnswerToQuestion($event)')
							.row.button-row
								input.btn.btn-primary.launch-button(type='submit', value='Save Quiz', class='btn btn-primary')
								input.btn.btn-primary.launch-button(class='btn btn-primary' value='Go Live!')
					.quiz-review(ng-hide='quizReviewStatus')
						h2.title-text Review Quiz
						img.gear-icon(src='assets/images/gear.svg', ng-click='editQuiz()')
						h3 Quiz Title: {{activeQuiz.name}}
						ul.active-quiz-question-list
							li(ng-repeat='question in activeQuiz.questions')
								span.bold{{ numbers[$index] }}:&nbsp&nbsp
								{{ question.name }}
								ul.active-quiz-answer-list
									li(ng-repeat='answer in question.answers')
										span.bold{{ letters[$index] }}:&nbsp&nbsp 
										{{ answer.content }}
					.quiz-edit(ng-hide='quizEditStatus')
						h2.title-text Edit Quiz
						img.gear-icon(src='assets/images/gear.svg', ng-click='reviewQuizFromGear()')
						span.pistara.bold.edit-quiz-title Quiz Title: 
						input.edit-quiz-name(type='text', value='{{activeQuiz.name}}')
						ul.active-quiz-question-list
							li(ng-repeat='question in activeQuiz.questions')
								span.bold{{ numbers[$index] }}:&nbsp&nbsp
								input.edit-question-input(type='text' value='{{ question.name }}')
								ul.active-quiz-answer-list
									li(ng-repeat='answer in question.answers')
										span.bold{{ letters[$index] }}:&nbsp&nbsp 
										input.edit-answer-input(type='text' value='{{ answer.content }}')
						input.btn.btn-primary.launch-button(type='submit', value='Update Quiz')
	.container-fluid.dashboard-main-survey(ng-hide='surveyDashboardStatus')
		.survey-generator
			.row
				.col-lg-3.col-md-3.col-sm-6.col-xs-12.dashboard-sidebar
					h1 Welcome, {{userName}}
					h1 My Quizzes
					.userQuizzes
						.userQuiz(ng-repeat='quizPage in userData.quizzes') 
							p Title: {{ quizPage.name }}
							p Length: {{ quizPage.length }} questions
				.col-lg-9.col-md-9.col-sm-6.col-xs-12
					.list-generator
						h2.title-text Create a Survey
						form(name='newSurvey' ng-submit='createNewQuiz()')
							input.quiz-name(type='text', name='name', class='form-control' ng-model='quiz.name' placeholder='QUIZ NAME')
							.col-lg-6.col-md-6.col-sm-6.col-xs-12.question-column
								input.question-input(placeholder='QUESTION ONE', type='text', name='question', class='form-control', ng-model="quiz.q1")
							.col-lg-6.col-md-6.col-sm-6.col-xs-12.answer-column
								input.answer-input(placeholder='ANSWER CHOICE A', type='text', name='answer', class='form-control', ng-model="quiz.q1.answers.a")
								input.answer-input(placeholder='ANSWER CHOICE B', type='text', name='answer', class='form-control' ng-model="quiz.q1.answers.b")
								input.answer-input(placeholder='ANSWER CHOICE C', type='text', name='answer', class='form-control' ng-model="quiz.q1.answers.c")
								input.answer-input(placeholder='ANSWER CHOICE D', type='text', name='answer', class='form-control' ng-model="quiz.q1.answers.d")
							.col-lg-6.col-md-6.col-sm-6.col-xs-12.question-column
								input.question-input(placeholder='QUESTION TWO', type='text', name='question', class='form-control', ng-model="quiz.q2.question")
							.col-lg-6.col-md-6.col-sm-6.col-xs-12.answer-column
								input.answer-input(placeholder='ANSWER CHOICE A', type='text', name='answer', class='form-control', ng-model="quiz.q2.answers.a")
								input.answer-input(placeholder='ANSWER CHOICE B', type='text', name='answer', class='form-control' ng-model="quiz.q2.answers.b")
								input.answer-input(placeholder='ANSWER CHOICE C', type='text', name='answer', class='form-control' ng-model="quiz.q2.answers.c")
								input.answer-input(placeholder='ANSWER CHOICE D', type='text', name='answer', class='form-control' ng-model="quiz.q2.answers.d")
							.button-row
								input.btn.btn-primary.launch-button(type='submit', value='Save Quiz', class='btn btn-primary')
								input.btn.btn-primary.launch-button(class='btn btn-primary', value='Go Live!')

